<?php
	class Verify extends BaseLogic{
		
		function __construct($showError=TRUE){
			parent:: __construct($showError);
			$this->tabName = TAB_PREFIX."verify";
			$this->fieldList=Array("vid", "uid", "mid", "vcontent", "picurl", "IP", "ctime", "state");
		}
		
		function addVerify($post){
			$post["ctime"]=time();
			if($this->add($post)){
				$this->messList[] = "任务提交成功.";
				return true;
			}else{
				$this->messList[] = "任务提交失败.";
				return false;
			}
		}
		
		function modVerify($postList){
			if($this->mod($postList)){
				$this->messList[] = "提交的任务修改成功.";
				return true;
			}else{
				$this->messList[] = "提交的任务修改失败.";
				return false;
			}
		}
		
		function delVerify($id){
			$sqlwhere="pid".$this->sqlWhere($id);
			if($this->del($sqlwhere)){
				$this->messList[] = "任务删除成功.";
				return true;
			}else{
				$this->messList[] = "任务删除失败.";
				return false;
			}
		}
		
		function getVerify($id){
			$sqlwhere="vid".$this->sqlWhere($id);
			return $this->get($sqlwhere);
		}
		
		function getAllVerify($offset,$num){
			$sql = "SELECT vid, vcontent, picurl,IP FROM {$this->tabName} ORDER BY vid ASC LIMIT $offset, $num";
			$result=$this->mysqli->query($sql);
			while($row=$result->fetch_assoc()){
				$data[]=$row;
			}
			return $data;
		}
		
		function getRowTotal(){
			$result=$this->mysqli->query("SELECT * FROM {$this->tabName}");
			return $result->num_rows;
		}
		
		function validateForm(){
			
		}
	}
?>